<?php
/*
 * Created on Feb 24, 2008
* @author max
*/
include_once(dirname(__FILE__).'/../database/dbDates.php');
class testdbDates extends UnitTestCase {
	function testdbDatesModule() {
		$d1=new RMHdate("02-26-08",null,"chef note","mgr note");
		$d2=new RMHdate("02-27-08",null,"","");
		$d3=new RMHdate("02-28-08",null,"","");
		$d4=new RMHdate("02-29-08",null,"","");
		$d5=new RMHdate("03-01-08",null,"","");

		$this->assertTrue(insert_dbDates($d1));
		$this->assertTrue(insert_dbDates($d2));
		$this->assertTrue(insert_dbDates($d3));
		$this->assertTrue(insert_dbDates($d4));
		$this->assertTrue(insert_dbDates($d5));

		$d1=select_dbDates("02-26-08");
		$this->assertTrue($d1!==null);
		$id=$d1->get_id();
		$this->assertTrue($id==="02-26-08");

		$this->assertTrue(delete_dbDates($d1));
		$this->assertTrue(delete_dbDates($d2));
		$this->assertTrue(delete_dbDates($d3));
		$this->assertTrue(delete_dbDates($d4));
		$this->assertTrue(delete_dbDates($d5));

		echo("testdbDates complete");
	}
}
?>
